home *** CD-ROM | disk | FTP | other *** search
- on getTaskList
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetTaskList)
- end
-
- on getTaskIDs
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetTaskIDs)
- end
-
- on taskName taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskName(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskName, taskID)
- end
-
- on taskParent taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskParent(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskParent, taskID)
- end
-
- on taskInstance taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskInstance(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskInstance, taskID)
- end
-
- on taskModule taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskModule(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskModule, taskID)
- end
-
- on taskEvents taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskEvents(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskEvents, taskID)
- end
-
- on getTaskWindowList taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("getTaskWindowList(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetTaskWindowList, taskID)
- end
-
- on getTaskWindowIDs taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("getTaskWindowIDs(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetTaskWindowIDs, taskID)
- end
-
- on getWindowTask windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowTask(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowTask, windowID)
- end
-
- on rudeQuitTask taskID, exitValue
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("rudeQuitTask(): taskID not an integer")
- return gVoid
- end if
- if not integerp(exitValue) then
- warning("rudeQuitTask(): exitValue not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mRudeQuitTask, taskID, exitValue)
- end
-
- on taskIsRunning taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("taskIsRunning(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mTaskIsRunning, taskID)
- end
-
- on feedTimeSlice taskID
- global gVoid, gMasterAppObject
- if not integerp(taskID) then
- warning("feedTimeSlice(): taskID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFeedTimeSlice, taskID)
- end
-
- on feedGenericTimeSlice
- global gMasterAppObject
- insureMasterApp()
- gMasterAppObject(mFeedGenericTimeSlice)
- end
-
- on directorTask
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mDirectorTask)
- end
-
- on getModuleList
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetModuleList)
- end
-
- on getModuleIDs
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetModuleIDs)
- end
-
- on moduleTask moduleID
- global gVoid, gMasterAppObject
- if not integerp(moduleID) then
- warning("moduleTask(): moduleID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mModuleTask, moduleID)
- end
-
- on moduleFilename moduleID
- global gVoid, gMasterAppObject
- if not integerp(moduleID) then
- warning("moduleFilename(): moduleID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mModuleFilename, moduleID)
- end
-
- on directorFilename
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mDirectorFilename)
- end
-
- on moduleName moduleID
- global gVoid, gMasterAppObject
- if not integerp(moduleID) then
- warning("moduleName(): moduleID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mModuleName, moduleID)
- end
-
- on moduleIsRunning moduleID
- global gVoid, gMasterAppObject
- if not integerp(moduleID) then
- warning("moduleIsRunning(): moduleID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mModuleIsRunning, moduleID)
- end
-
- on directorModule
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mDirectorModule)
- end
-
- on getParentWindowList
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetParentWindowList)
- end
-
- on getParentWindowIDs
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetParentWindowID)
- end
-
- on getChildWindowList windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getChildWindowList(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetChildWindowList, windowID)
- end
-
- on getChildWindowIDs windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getChildWindowIDs(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetChildWindowIDs, windowID)
- end
-
- on windowParent windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowParent(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowParent, windowID)
- end
-
- on getWindowParent windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowParent(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowParent, windowID)
- end
-
- on getHighestWindowParent windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getHighestWindowParent(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetHighestWindowParent, windowID)
- end
-
- on directorMainWindow
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mDirectorMainWindow)
- end
-
- on directorStageWindow
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mDirectorStageWindow)
- end
-
- on windowName windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowName(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowName, windowID)
- end
-
- on getWindowName windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowName(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowName, windowID)
- end
-
- on setWindowName windowID, newText
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("setWindowName(): windowID not an integer")
- return gVoid
- end if
- if not stringp(newText) then
- warning("setWindowName(): newText not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowName, windowID)
- end
-
- on windowHasChildren windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowHasChildren(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowHasChildren, windowID)
- end
-
- on windowType windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowType(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowType, windowID)
- end
-
- on getWindowType windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowType(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowType, windowID)
- end
-
- on windowIsInvisible windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowIsInvisible(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowIsInvisible, windowID)
- end
-
- on getActiveWindow
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetActiveWindow)
- end
-
- on setActiveWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("setActiveWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mSetActiveWindow, windowID)
- end
-
- on getKeyboardInputWindow
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetKeyboardInputWindow)
- end
-
- on setKeyboardInputWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("setKeyboardInputWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mSetKeyboardInputWindow, windowID)
- end
-
- on captureMouseInput windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("captureMouseInput(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mCaptureMouseInput, windowID)
- end
-
- on releaseMouseInput
- global gMasterAppObject
- insureMasterApp()
- gMasterAppObject(mReleaseMouseInput)
- end
-
- on getParentWindowTopChild windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getParentWindowTopChild(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetParentWindowTopChild, windowID)
- end
-
- on getDesktopWindow
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetDesktopWindow)
- end
-
- on getWindowOutsideRect windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowOutsideRect(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowOutsideRect, windowID)
- end
-
- on getWindowInsideRect windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("getWindowInsideRect(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetWindowInsideRect, windowID)
- end
-
- on setWindowOutsideRect windowID, left, top, bottom, right
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("setWindowOutsideRect(): windowID not an integer")
- return gVoid
- end if
- if not integerp(left) or not integerp(top) or not integerp(bottom) or not integerp(right) then
- warning("setWindowOutsideRect(): rect dimensions aren't all integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mSetWindowOutsideRect, windowID, left, top, bottom, right)
- end
-
- on setWindowRect windowID, left, top, bottom, right
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("setWindowRect(): windowID not an integer")
- return gVoid
- end if
- if not integerp(left) or not integerp(top) or not integerp(bottom) or not integerp(right) then
- warning("setWindowRect(): rect dimensions aren't all integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mSetWindowRect, windowID, left, top, bottom, right)
- end
-
- on closeWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("closeWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mCloseWindow, windowID)
- end
-
- on windowExists windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowExists(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowExists, windowID)
- end
-
- on windowToFront windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowToFront(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowToFront, windowID)
- end
-
- on windowToBack windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("windowToBack(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mWindowToBack, windowID)
- end
-
- on hideWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("hideWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mHideWindow, windowID)
- end
-
- on showWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("showWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mShowWindow, windowID)
- end
-
- on minimizeWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("minimizeWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mMinimizeWindow, windowID)
- end
-
- on restoreWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("restoreWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mRestoreWindow, windowID)
- end
-
- on maximizeWindow windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("maximizeWindow(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mMaximizeWindow, windowID)
- end
-
- on launch theProgramFile, theCommandLineArguments
- global gMasterAppObject
- if not stringp(theProgramFile) then
- warning("launch(): theProgramFile not a string")
- end if
- if not stringp(theCommandLineArguments) then
- warning("launch(): theCommandLineArguments not a string")
- end if
- insureMasterApp()
- return gMasterAppObject(mLaunch, theProgramFile, theCommandLineArguments)
- end
-
- on launchButDontActivate theProgramFile, theCommandLineArguments
- global gMasterAppObject
- if not stringp(theProgramFile) then
- warning("launchButDontActivate(): theProgramFile not a string")
- end if
- if not stringp(theCommandLineArguments) then
- warning("launchButDontActivate(): theCommandLineArguments not a string")
- end if
- insureMasterApp()
- return gMasterAppObject(mLaunchButDontActivate, theProgramFile, theCommandLineArguments)
- end
-
- on launchHidden theProgramFile, theCommandLineArguments
- global gMasterAppObject
- if not stringp(theProgramFile) then
- warning("launchHidden(): theProgramFile not a string")
- end if
- if not stringp(theCommandLineArguments) then
- warning("launchHidden(): theCommandLineArguments not a string")
- end if
- insureMasterApp()
- return gMasterAppObject(mLaunchHidden, theProgramFile, theCommandLineArguments)
- end
-
- on launchMinimized theProgramFile, theCommandLineArguments
- global gMasterAppObject
- if not stringp(theProgramFile) then
- warning("launchMinimized(): theProgramFile not a string")
- end if
- if not stringp(theCommandLineArguments) then
- warning("launchMinimized(): theCommandLineArguments not a string")
- end if
- insureMasterApp()
- return gMasterAppObject(mLaunchMinimized, theProgramFile, theCommandLineArguments)
- end
-
- on launchMaximized theProgramFile, theCommandLineArguments
- global gMasterAppObject
- if not stringp(theProgramFile) then
- warning("launchMaximized(): theProgramFile not a string")
- end if
- if not stringp(theCommandLineArguments) then
- warning("launchMaximized(): theCommandLineArguments not a string")
- end if
- insureMasterApp()
- return gMasterAppObject(mLaunchMaximized, theProgramFile, theCommandLineArguments)
- end
-
- on locateExecutable theFile
- global gVoid, gMasterAppObject
- if not stringp(theFile) then
- warning("locateExecutable(): theFile not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mLocateExecutable, theFile)
- end
-
- on getShortFileName theFile
- global gVoid, gMasterAppObject
- if not stringp(theFile) then
- warning("getShortFileName(): theFile not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetShortFileName, theFile)
- end
-
- on getLongFileName theFile
- global gVoid, gMasterAppObject
- if not stringp(theFile) then
- warning("getLongFileName(): theFile not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mGetLongFileName, theFile)
- end
-
- on openDocument theFile
- global gVoid, gMasterAppObject
- if not stringp(theFile) then
- put "here"
- warning("openDocument(): theFile not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mOpenDocument, theFile)
- end
-
- on printDocument theFile
- global gVoid, gMasterAppObject
- if not stringp(theFile) then
- warning("printDocument(): theFile not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mPrintDocument, theFile)
- end
-
- on getDefaultPrinter
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetDefaultPrinter)
- end
-
- on setDefaultPrinter printerName
- global gVoid, gMasterAppObject
- if not stringp(printerName) then
- warning("setDefaultPrinter(): printerName not a string")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mSetDefaultPrinter, printerName)
- end
-
- on getInstalledPrinters
- global gMasterAppObject
- insureMasterApp()
- return gMasterAppObject(mGetInstalledPrinters)
- end
-
- on instanceTask instanceID
- global gVoid, gMasterAppObject
- if not integerp(instanceID) then
- warning("instanceTask(): instanceID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mInstanceTask, instanceID)
- end
-
- on instanceIsRunning instanceID
- global gVoid, gMasterAppObject
- if not integerp(instanceID) then
- warning("instanceIsRunning(): instanceID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mInstanceIsRunning, instanceID)
- end
-
- on fakeMouseClick windowID, x, y
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("fakeMouseClick(): windowID not an integer")
- return gVoid
- end if
- if not integerp(x) or not integerp(y) then
- warning("fakeMouseClick(): x and y coordinates not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeMouseClick, windowID, x, y)
- end
-
- on fakeMouseClickWait windowID, x, y
- global gVoid, gMasterAppObject
- put EMPTY
- if not integerp(windowID) then
- put "R"
- warning("fakeMouseClickWait(): windowID not an integer")
- return gVoid
- end if
- if not integerp(x) or not integerp(y) then
- put "e"
- warning("fakeMouseClickWait(): x and y coordinates not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeMouseClickWait, windowID, x, y)
- end
-
- on fakeCharacter windowID, theChar
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("fakeCharacter(): windowID not an integer")
- return gVoid
- end if
- if not stringp(theChar) then
- warning("fakeCharacter(): theChar not a string")
- return gVoid
- end if
- if not (the number of chars in theChar = 1) then
- warning("fakeCharacter(): theChar more than one character")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeCharacter, windowID, theChar)
- end
-
- on fakeCharacterWait windowID, theChar
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("fakeCharacterWait(): windowID not an integer")
- return gVoid
- end if
- if not stringp(theChar) then
- warning("fakeCharacterWait(): theChar not a string")
- return gVoid
- end if
- if not (the number of chars in theChar = 1) then
- warning("fakeCharacterWait(): theChar more than one character")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeCharacterWait, windowID, theChar)
- end
-
- on fakeCharCode windowID, charNum, codeNum
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("fakeCharCode(): windowID not an integer")
- return gVoid
- end if
- if not integerp(charNum) or not integerp(codeNum) then
- warning("fakeCharCode(): charNum and codeNum not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeCharCode, windowID, charNum, codeNum)
- end
-
- on fakeCharCodeWait windowID, charNum, codeNum
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("fakeCharCodeWait(): windowID not an integer")
- return gVoid
- end if
- if not integerp(charNum) or not integerp(codeNum) then
- warning("fakeCharCodeWait(): charNum and codeNum not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mFakeCharCodeWait, windowID, charNum, codeNum)
- end
-
- on showMenu windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("showMenu(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mShowMenu, windowID)
- end
-
- on showMenuWait windowID
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("showMenuWait(): windowID not an integer")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mShowMenuWait, windowID)
- end
-
- on anyWindowAtPoint x, y
- global gVoid, gMasterAppObject
- if not integerp(x) or not integerp(y) then
- warning("anyWindowAtPoint(): x and y coordinates not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mAnyWindowAtPoint, x, y)
- end
-
- on childWindowAtPoint windowID, x, y
- global gVoid, gMasterAppObject
- if not integerp(windowID) then
- warning("childWindowAtPoint(): windowID not an integer")
- return gVoid
- end if
- if not integerp(x) or not integerp(y) then
- warning("childWindowAtPoint(): x and y coordinates not both integers")
- return gVoid
- end if
- insureMasterApp()
- return gMasterAppObject(mChildWindowAtPoint, windowID, x, y)
- end
-
- on insureMasterApp
- global j2736D2937m2382, gMasterAppObject, gVoid
- if objectp(gMasterAppObject) then
- return 1
- end if
- if not objectp(factory("MasterApp")) then
- if not openMasterApp() then
- warning("insureMasterApp(): openMasterApp() failed")
- abort()
- end if
- end if
- set j2736D2937m2382 to "Y7729J3338j3942"
- set gMasterAppObject to MasterApp(mnew)
- set j2736D2937m2382 to gVoid
- if not objectp(gMasterAppObject) then
- warning("insureMasterApp(): couldn't create object")
- abort()
- end if
- return 1
- end
-
- on openMasterApp
- global gMasterAppObject
- if objectp(gMasterAppObject) then
- return 1
- end if
- if objectp(factory("MasterApp")) then
- return 1
- end if
- set xoName to "MastrApp.dll"
- if the machineType < 256 then
- set xoName to "MasterApp XObject"
- end if
- if not fileExists(the pathName & xoName) then
- warning("loadMasterApp(): XObject not open and can't be located")
- return 0
- end if
- openXLib(xoName)
- if not objectp(factory("MasterApp")) then
- warning("loadMasterApp(): XObject located, but didn't register")
- return 0
- end if
- return 1
- end
-
- on closeMasterApp
- global gMasterAppObject
- if objectp(gMasterAppObject) then
- gMasterAppObject(mdispose)
- end if
- if not objectp(factory("MasterApp")) then
- return 1
- end if
- if the machineType >= 256 then
- closeXLib("MastrApp.dll")
- else
- closeXLib("MasterApp XObject")
- end if
- if objectp(factory("MasterApp")) then
- warning("closeMasterApp(): XObject file couldn't be closed (objects still exist?)")
- return 0
- end if
- return 1
- end
-
- on fileExists theFile
- set thePath to pathOnly(theFile)
- if thePath = EMPTY then
- set thePath to the pathName
- end if
- set fileName to fileOnly(theFile)
- repeat with i = 1 to the maxinteger
- set thisFile to getNthFileNameInFolder(thePath, i)
- if thisFile = EMPTY then
- return 0
- end if
- if thisFile = fileName then
- return 1
- end if
- end repeat
- if not objectp(factory("FileIO")) then
- return 0
- end if
- set fioObject to fileio(mnew, "read", theFile)
- if objectp(fioObject) then
- fioObject(mdispose)
- return 1
- end if
- return 0
- end
-
- on fileOnly thePath
- set oldDelim to the itemDelimiter
- set the itemDelimiter to ":"
- if the machineType >= 256 then
- set the itemDelimiter to "\"
- end if
- set ni to the number of items in thePath
- set returnValue to item ni of thePath
- set the itemDelimiter to oldDelim
- return returnValue
- end
-
- on pathOnly thePath
- set oldDelim to the itemDelimiter
- set the itemDelimiter to ":"
- if the machineType = 256 then
- set the itemDelimiter to "\"
- end if
- set ni to the number of items in thePath
- if ni = 1 then
- set returnValue to EMPTY
- else
- set returnValue to item 1 to ni - 1 of thePath & the itemDelimiter
- end if
- set the itemDelimiter to oldDelim
- return returnValue
- end
-
- on fileThere theFile
- warning("fileThere(): obsolete. Use fileExists() instead.")
- return fileExists(theFile)
- end
-
- on warning msg
- global gShowWarning
- if not integerp(gShowWarning) then
- return
- end if
- if gShowWarning <> 1 then
- return
- end if
- alert(msg)
- end
-
- on hideWarnings
- global gShowWarning
- set gShowWarning to 0
- end
-
- on showWarnings
- global gShowWarning
- set gShowWarning to 1
- end
-